<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Smart Ticket</title>
<link href="/resources/css/style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&region=GB"></script>
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script>

<script>
function initialize() {
	var lat = ${sight.latitude };
	var lng = ${sight.longitude };
	var titleString = "${sight.name}";
	var popUpString = "${sight.description}";
	var Src = "test.png";
	var imgSrc = "<div><img src=";
	var imgSrc2 = "></div>";
	var total = imgSrc+Src+imgSrc2;

	var myLatlng = new google.maps.LatLng(lat,lng); 
	var myOptions = {   zoom: 15,   center: myLatlng,   mapTypeId: google.maps.MapTypeId.ROADMAP };
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	var georssLayer = new google.maps.KmlLayer('localhost');

	georssLayer.setMap(map);
//마커생성

	var marker = new google.maps.Marker({
	position: myLatlng, 
	map: map,
	title: titleString
	});

//클릭하면 발생
	var infowindow = new google.maps.InfoWindow();
	//infowindow.setContent(popUpString);
	infowindow.setContent(popUpString + total);
	google.maps.event.addListener(marker, 'click', function() {
	infowindow.open(map, marker);
	});

	google.maps.event.addListener(map, 'click', function(event) {
	placeMarker(event.latLng);
	});
}
	
</script>
</head>
<body onload="initialize()">